package adv6.thread;

/**
 * @author oldliu
 * @since 1.0
 */
public class Thread1  extends Thread{
    public Thread1(String name){
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(super.getName()+" =====" +i);
            try {
                super.sleep(500);
            } catch (InterruptedException e) {
                 e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        //主线程+5个子线程
        for (int i = 1; i <= 5; i++) {
            new Thread1("线程"+i).start();
            //new Thread1("线程"+i).run();
        }
    }
}
